<%@ page language="java" import="java.util.*,java.sql.*,Pluto.function"
pageEncoding="UTF-8"%>
<jsp:useBean id="conn" class="Pluto.DBConnection" scope="session" />
<%
	String big_id=request.getParameter("big_id");//region big_id
	String small_id = request.getParameter("small_id");//country
	
	ResultSet rs = null;
	List lsmall_id = new ArrayList();
	List types = new ArrayList();

	

	try {
		if(big_id != null)
		{
			rs=conn.executeQuery("SELECT small_id FROM smallitem where big_id='"+big_id+"'");//country countries region
			while (rs.next())
			{
				lsmall_id.add(rs.getString(1));
			}
		}
		if(small_id != null)
		{
			rs=conn.executeQuery("SELECT type FROM smallitem where small_id='"+small_id+"'");
			while (rs.next())
			{
				types.add(rs.getString(1));
			}
		}
		conn.close();
	}  catch (Exception e)  {   
		e.printStackTrace();
	}
	response.setContentType("text/xml; charset=UTF-8");
	response.setHeader("Cache-Control", "no-cache");
	out.println("<response>");
	for(int i=0;i<lsmall_id.size();i++)
	{
		out.println("<small_id>" + lsmall_id.get(i).toString() + "</small_id>");
	}
	for(int i=0;i<types.size();i++)
	{
		out.println("<type>" + types.get(i).toString() + "</type>");
	}
	out.println("</response>");
	out.close();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>


</head>
</html>